#ifndef INIT_H
#define INIT_H

#include "head.h"
#include "ui_visual2.h"

class init:public QThread
{
    Q_OBJECT
public:
    static init* getInstance();
    ~init();
    explicit init(QObject *parent = nullptr);
    void setParent(QObject *parent);
    void setUI(Ui_visual2* ui);

protected:
    void run();

private:
    static QScopedPointer<init> self;
    QObject *parent=nullptr;
    Ui_visual2* ui=nullptr;

public slots:
    // void initButton();
    // void initEdit();
    // void initParas();
    void initCamera();
};

class initChildThread:public QObject
{
    Q_OBJECT
public:
    static initChildThread* getInstance();
    explicit initChildThread(QObject *parent = nullptr);
    void setParent(QObject *parent);
    void setUI(Ui_visual2* ui);
    ~initChildThread();

    void initComponent();
    void exitComponent();
private:
    static QScopedPointer<initChildThread> self;
    QObject *parent=nullptr;
    Ui_visual2* ui=nullptr;

    void initLink();
    void initImageDeal();
    void initDisplay();
    void initCalibration();
};

#endif // INIT_H